package cn.com.simple.learning.designpattern.behavior.responsibility;

/**
 * @author Jianxing.Jia
 * @date 2022/2/9
 * @description 描述信息
 */
public class ResponsibilityTest {

    public static void main(String[] args) {
        RuleHandler signRuleHandler = new SignRule();
        RuleHandler lessonPeriodRule = new LessonPeriodRule();
        RuleHandler scoreRule = new ScoreRule();

        Rule rule = new Rule(true, true, true);

        signRuleHandler.setNextRuleHandler(lessonPeriodRule);
        lessonPeriodRule.setNextRuleHandler(scoreRule);

        boolean qualified = signRuleHandler.apply(rule);
        System.out.println(qualified);
    }
}
